package com.ruoyi.product.domain.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * 活动SKU平铺查询结果DTO
 * 用于接收数据库查询的平铺结果，然后在Service层进行分组处理
 */
@Data
public class ActivitySkuFlatDto {
    // Activity fields
    private Long activityId;
    private String activityName;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date startTime;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date endTime;
    private String activityDesc;
    private String posterUrl;

    // SKU fields
    private Long id;
    private Long spuId;
    private String code;
    private Long categoryId;
    private String specData;
    private String specValues;
    private BigDecimal price;
    private BigDecimal originalPrice;
    private BigDecimal costPrice;
    private Long stock;
    private Long lowStock;
    private BigDecimal weight;
    private BigDecimal volume;
    private String productImages;
    private Integer status;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createdAt;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date updatedAt;
    private String name;
    private String level;
    private String spuName;
    private String spuTitle;
    private String spuDescription;
    private String url;
    private String urls; // GROUP_CONCAT result as string
    private List<String> specNameGroup;
    private List<String> specValueGroup;
    /**
     * 临时字段：从数据库获取的原始规格组名字符串
     */
    @JsonIgnore
    private String specNameGroupRaw;

    /**
     * 临时字段：从数据库获取的原始规格组值字符串
     */
    @JsonIgnore
    private String specValueGroupRaw;
}
